#ifndef _WORLD_STATE_H_
#define _WORLD_STATE_H_

#include "RigidBody.h"
#include <vector>

using namespace std;

typedef struct  
{
	Vec3d collisionPosition;	
} CollisionPoint;

typedef vector<Vec3d> CollisionPointList;

class PhyEngine
{
public:
	PhyEngine(void);
	~PhyEngine(void);
	PhyEngine(RigidBodyList* bodies, int num_collision_steps, bool edge_intersection);	

	void processCollisions(double dt);	

	CollisionPointList* checkCollision(RigidBody* b0, RigidBody* b1);

	void resolveCollision(RigidBody* b0, RigidBody* b1, CollisionPointList* cps);

	void generateForce(Vec3d p, Vec3d n, double d, double r, RigidBody* b0, RigidBody* b1);

	void generateGravity();

	void update(double dt);

	RigidBodyList* bodies;	
	
	bool edge_intersection;

};

#endif


